package Studys.Service;

import Studys.Bean.User;
import Studys.Dao.UserDao;

public class UseService {
    public User login(String name) {

       UserDao dao = new UserDao();
//        User user = dao.findUserByNameAndPwd(name,pwd);
        User user = null;
        try {
            //调用的方法会有异常，这里不宜抛出
            //调用方法返回值是一个User对象
            user = dao.findUserByNameAndPwd(name);
        } catch (Exception e) {
            e.printStackTrace();
        }
        //将user对象返回给调用者
        return user;
    }
}
